package com.sky.mapper;

import com.sky.annocation.AutoFill;
import com.sky.entity.User;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * Description:
 * User: 35391
 * Package: com.sky.mapper
 * Date: 2025/7/15
 * Time: 下午12:15
 * Version: 1.0
 */
@Mapper
public interface UserMapper {
    /**
     * 根据openid查询用户
     * @param openid
    * @return
     */
    User getByOpenid(String openid);

    /**
     * 插入数据
     * @param user
     */
//    @AutoFill(value = OperationType.INSERT)
    void insert(User user);

    /**
     * 根据id查询用户
     * @param userId
     * @return
     */
    User getById(Long userId);

    /**
     * 根据动态条件查询用户数量
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
